<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    table{
        width: 500px;
        text-align: center;
        border-collapse: collapse;
    }
    thead{
        width: 100%;
    }
    tr{
        border-bottom: 1px solid tomato;
        height: 35px;
        cursor: pointer;
    }
    thead tr{
        width: 25%;
    }
    .bj {
        background: #84ff9d;
    }
</style>
<body>
<table>
    <thead>
        <tr>
            <th>代码</th>
            <th>名称</th>
            <th>涨跌幅</th>
            <th>成交额</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>6788886</td>
            <td>C集团</td>
            <td>+15.973%</td>
            <td>95.46亿</td>
        </tr>
        <tr>
            <td>6789857</td>
            <td>Z传媒有限公司</td>
            <td>+10.283%</td>
            <td>62.15亿</td>
        </tr>
        <tr>
            <td>6789261</td>
            <td>Y网络有限公司</td>
            <td>+9.561%</td>
            <td>53.75亿</td>
        </tr>
    </tbody>
</table>
<script>
    var trs = document.querySelector('tbody').querySelectorAll('tr');
        for (var i = 0;i < trs.length;i++){
            trs[i].onmouseover = function () {
                this.className = 'bj';
            };
            trs[i].onmouseout = function () {
                this.className = '';
            }
    }
</script>
</body>
</html>